-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Do not install playwright in CI #12607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for the pull request, @jjspace! ✅ We can confirm we have a CLA on file for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, seems like a straightforward approach to a lot of saved time. 👍 from me. Just one comment on the script.
const { env } = process; | ||
|
||
const isCI = !!( | ||
env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I do appreciate the robust approach, why did we decide to cover all possible types of CI providers? Just remember that we'd need to maintain this script going forward, and I could see it becoming out of date quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggetz it was simply because the library I was copying from already had them all and it was the same amount of effort (right now) to copy all of them vs copying one. I can remove them if you think it's better for us long term to focus on our use case, can re-add if we ever need to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me! Thanks!
Description
When testing CI build support for #12574 I was running the CI builds a lot. I took a brief look into ways to speed up CI and realized we install all the playwright dependencies for every CI job even though none of them currently do anything with CI. On average the
npm install
steps seems to take~1m 20s
in most jobs. Without doing theplaywright install
step this drops to only~20-30s
. Compare thedeploy
job in main to the deploy job on this branch's commitOnce we decide to move forward with #12355 we can force it to install specifically in the CI workflows it's needed.
As an aside I did spend a little time looking at turning on caching for the npm packages in CI. This seems like it would be really helpful but relies on a "cache key" that defines when to invalidate the cache. They heavily suggest using a
package-lock.json
file as that will always change with every dependency. However we don't use one so there's a decent chance it will not invalidate the cache when it actually should for version ranges inpackage.json
. If we could find a way to set our own key based on the "wanted" values ofnpm outdated
I think that would be our "ideal" setup. That said the node action currently does not allow setting our own key anyway but there's a PR for it.On top of that the largest slowdown with the install step from Playwright is downloading the browser binaries and they specifically say that you should not cache these. Even if you did rebuilding them would take as much time as re-downloading.
Issue number and link
No issue
Testing plan
npm install
locally and make sure playwright does still install and download browsers locallyCI=true npm install
to see that running it in CI does not do the playwright installAuthor checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change